import { Injectable } from '@angular/core';
import { HttpClient } from '../../../providers/httpClient';
import { Config } from '../../../providers/config';

@Injectable()
export class BcwWarnService {
	constructor(
		public httpClient: HttpClient,
		public config: Config
	) { }

  getMonitorData(l_days) {
	  let postBody = {
      "module": "OAServer",
      "method": "getMonitorData",
      "params": {
        "l_days": l_days
      }
    };

	  return this.httpClient.post(postBody, {
	    isShowLoading: true
    })
  };
  getExceptionRuleDetail(l_days, vc_memo) {
    let postBody = {
      "module": "OAServer",
      "method": "getExceptionRuleDetail",
      "params": {
        "l_days": l_days,
        "vc_memo": vc_memo
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: false
    });
  }

  saveBcwPriorityLevels(priority_levels) {
    let postBody = {
      "module": "OAServer",
      "method": "saveBcwPriorityLevels",
      "params": {
        "priority_levels": priority_levels
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: true
    })
  };

  changeMonitorDataReadStatus(data) {
    let postBody = {
      "module": "OAServer",
      "method": "changeMonitorDataReadStatus",
      "params": {
        "l_ruleid": data["l_ruleid"],
        "l_bussiness_nodeid": data["l_bussiness_nodeid"],
        "l_schedule_date": data["l_schedule_date"],
        "isRead": true
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: false
    })
  };


}
